package com.club325.voicemicroblog.persist.test;

import com.club325.voicemicroblog.database.hibernateutil.HibernateUtil;
import com.club325.voicemicroblog.domain.ShortMSG;

public class ShortMSGEnvironment implements Environment {
	protected ShortMSG sMSG1, sMSG2,sMSG3 , sMSG1r, sMSG2r;
	
	protected static final String Label1 = "TestLabel1";
	protected static final String Label2 = "TestLabel2";
	protected static final String Label3 = "TestLabel3";
	protected static final String Label1r = "TestLabel1r";
	protected static final String Label2r = "TestLabel2r";
	protected static final String SenderID1 = UserEnvironment.TestUserID1;
	protected static final String SenderID2 = UserEnvironment.TestUserID2;
	protected static final String SenderID3 = UserEnvironment.TestUserID3;
	protected static final String RecieverID1 = "TestRecieverID1";
	protected static final String RecieverID2 = "TestRecieverID2";
	protected static final String RecieverID3 = "TestRecieverID3";
	protected static final String ContentText1 = "TestContent1";
	protected static final String ContentText2 = "TestContetn2";
	protected static final String ContentText3 = "TestContetn3";

	public void setup() {
		sMSG1 = new ShortMSG();
		sMSG2 = new ShortMSG();
		sMSG3 = new ShortMSG();
		sMSG1r = new ShortMSG();
		sMSG2r = new ShortMSG();
		
		sMSG1.setTitle(Label1);
		sMSG2.setTitle(Label2);
		sMSG3.setTitle(Label3);
		sMSG1r.setTitle(Label1r);
		sMSG2r.setTitle(Label2r);
		sMSG1.setSenderID(SenderID1);
		sMSG2.setSenderID(SenderID2);
		sMSG3.setSenderID(SenderID3);
		sMSG1r.setSenderID(SenderID1);
		sMSG2r.setSenderID(SenderID2);
		sMSG1.setRecieverID(RecieverID1);
		sMSG2.setRecieverID(RecieverID2);
		sMSG3.setRecieverID(RecieverID3);
		sMSG1r.setRecieverID(RecieverID1);
		sMSG2r.setRecieverID(RecieverID2);
		sMSG1.setContent(ContentText1);
		sMSG2.setContent(ContentText2);
		sMSG3.setContent(ContentText3);
		sMSG1r.setContent(ContentText1);
		sMSG2r.setContent(ContentText2);
		HibernateUtil.add(sMSG1);
		HibernateUtil.add(sMSG2);
		HibernateUtil.add(sMSG3);
		HibernateUtil.add(sMSG1r);
		HibernateUtil.add(sMSG2r);
	}

	public void tearDown() {
		HibernateUtil.delete(sMSG1);
		HibernateUtil.delete(sMSG2);
		HibernateUtil.delete(sMSG3);
		HibernateUtil.delete(sMSG1r);
		HibernateUtil.delete(sMSG2r);
	}
}
